<template>
  <div>
  <router-view></router-view>
<div class="ada"  v-if="is">
  <Search @fn='obj'></Search>
<Swipe></Swipe>
<Tabbar></Tabbar>
<navigation></navigation> 
</div>
<!-- <searchPopup></searchPopup> -->

  </div>
</template>

<script>
//搜索框
// import searchPopup from '@/views/search/searchPopup.vue'
//底部tabbar
import Tabbar from '@/components/Tabbar.vue'
//搜索框
import Search from '@/components/HomePage/Search.vue'
//轮播图
import Swipe from '@/components/HomePage/Swipe.vue'
//导航
import navigation from '@/components/HomePage/navigation.vue'
// import { watch } from 'node_modules/vue/types'
export default {
  name: "",
  data() {
    return {
      is:true
    };
  },
  components:{
      Search,
      Swipe,
      Tabbar,
      navigation,
      // searchPopup
  },
  methods:{
    obj(str){
      this.is=str
      // console.log(this.is);
    }
  },
  mounted(){
  // console.log(this.$router.path);
  },
  watch:{
    $route:{
      handler(val){
        // console.log(val.path);
        if(val.path=='/home/searchPopup'){
          this.is=false
        }else{
          this.is=true
        }
      },
      deep:true,
      immediate:true
    }



    // $route(newvalue,oldvalue){
    //   console.log(newvalue,oldvalue);
    //   console.log(this.$route);
    //   if(this.$route.path=='/home'){
    //     this.is==oldvalue
    //     console.log(this.is);
    //   }
    //   else{
    //     this.is=false
    //   }
    //   // console.log(this.$route);
    // }
  }
};
</script>
<style scoped lang='less'>

</style>